import { http } from "@/utils/http";

/** 创建支付订单 */
export const paymentCreate = (data?: number) => {
  return http.request<any>("post", "/api/payment/create", {
    data: {
      amount: data
    }
  });
};

/** 查询支付订单状态 */
export const paymentStatus = (params: { orderNo: string }) => {
  return http.request<any>("get", "/api/payment/order/status", { params });
};

/** 查询支付订单详情 */
export const paymentDetails = (orderNo: string) => {
  return http.request<any>("get", `/api/payment/order/${orderNo}`);
};

export const paymentAddressQrcode = (orderNo: string) => {
  return http.request<any>("get", `/api/payment/qrcode/${orderNo}`, {
    responseType: "blob"
  });
};
